package com.zy.web.demo.shejimoshi.danli;

/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/8/19 11:08
 * 枚举
 * 枚举不易被破坏，枚举类是线程安全的，并且只会加载一次，写法简写
 */
public class DanLi7 {

    private DanLi7(){};

    private enum DanLi7Test{
        INSTANCE;

        private final DanLi7 zy;

        DanLi7Test(){
            zy = new DanLi7();
        }

        private DanLi7 getInstance(){
            return zy;
        }
    }

    public static DanLi7 getInstance(){
        return DanLi7Test.INSTANCE.getInstance();
    }

}
